/**
*@author Syrings Tam 
*@version 13 March 2012
// test the location
//********************************************/
package testCell;
import static org.junit.Assert.*;
import org.junit.*;

import player.*;
import cell.*;

public class TestGoToHospital {
	private Player tester;
	private GoToHospitalCell GTH;
	@Before
	public void setUp() throws Exception {
		 tester = new Player();
		 tester.setCell(19); 
		 /**
		 *@author Syrings Tam 
		 *@version 13 March 2012
		 //Assume originally at cell 19**/// 
		 GTH = new GoToHospitalCell(0);
	}

	@After
	public void tearDown() throws Exception {
		tester = new Player();
	}
	
	/**
	 *@author Syrings Tam 
	 *@version 13 March 2012
	 //Test the the method trigger cell of GoToHospital
	  * When Player still have the escape magic card**/// 
	@Test
	public void testTriggerCell_1() {
		tester.setMagicCards(0, true);
		GTH.TriggerCell(tester);
		
		int result1=tester.getCell();
		int result2=tester.getGridX();
		int result3=tester.getGridY();
		
		assertEquals(19, result1);
		assertEquals(6, result2);
		assertEquals(5, result3);
	}
	
	
	// When Player don't have the escape magic card.
	@Test
	public void testTriggerCell_2() {
		tester.setMagicCards(0, false); // remove the MagicCard1
		GTH.TriggerCell(tester);
		
		int result1=tester.getCell();
		int result2=tester.getGridX();
		int result3=tester.getGridY();
		
		assertEquals(24, result1);
		assertEquals(6, result2);
		assertEquals(5, result3);
	}
}
